//
//  ContactDao.h
//  SouthChina
//
//  Created by creator_lq on 14/12/3.
//  Copyright (c) 2014年 科创. All rights reserved.
//

#import "DateBaseHelper.h"
#import "Contact.h"

#define RECENTLYCONTACT @"9999"

@interface ContactDao : DateBaseHelper

+(BOOL)updateContact:(Contact*)contact;

+(BOOL)updataDBwithSQLiteStatement:(NSArray*) listmap;

+(BOOL)updataDBwithSQLiteStatement:(NSArray*) listmap clearFisrt:(BOOL)clear;

//查询机构列表（数字）
+(NSArray*)queryAllOrgWithCount;

//查询结构下面的联系人数量
+(int)queryChildCount:(NSString*)orgid;


+(NSArray*)getLeftNodeContact:(NSString*)orgid;

+(NSArray*)searcherNodeContact:(NSString*)orgid key:(NSString*)key;
+(Contact*)getContactById:(NSString*)contacdId;

+(Contact*)getContactByPKId:(NSString*)pkid;

+(BOOL)isMyFriend:(NSString*) pkid;

+(BOOL)insertStrangerOrg;

+(BOOL)insertStrangerContactFromNet:(NSDictionary*)contcts;

+(NSArray*)getContactByWhere:(NSString*)ConditionSQL;
+(NSMutableArray*)queryOrgWithCount:(NSString*) type;
+(NSArray*)queryRecentlyCcontact:(NSString*)key;
+(NSMutableArray*)queryOrgWithrefidandkey:(NSString*)key ConditionSQL:(NSString*)wheresql;

+(Contact*)getContactByWhereSQL:(NSString*)ConditionSQL;

////20151010剔重
+(NSArray*)getDistinctContactByWhere:(NSString*)ConditionSQL;

@end
